<%@ Page Language="C#" %>
<%@ OutputCache Duration="3600" VaryByParam="none" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataSrc1.ConnectionString = ConfigurationManager.ConnectionStrings["TDConnString"].ConnectionString;
    }

    protected void SqlDataSrc1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        e.Command.CommandTimeout = 0;
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Active Property Lookup</title>
<link href="../Styles/acc.css" rel="stylesheet" type="text/css" />
</head>
<body style="font: normal 9pt Calabri, Arial, San-Serif;">
<form id="form1" runat="server">
<table style="width:100%;">
<tr><td align="left"><h3>Active Property Lookup</h3></td><td align="right"><%=DateTime.Now.ToString() %></td></tr>
</table>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSrc1" style="width:98%;"
    EnableModelValidation="True" AllowSorting="True" CellPadding="4" 
    ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" 
    HorizontalAlign="Center">
    <AlternatingRowStyle BackColor="#dddddd" ForeColor="#284775" />
    <Columns>
        <asp:BoundField DataField="STATE" HeaderText="STATE" SortExpression="STATE" >
        <HeaderStyle VerticalAlign="Bottom" />
        <ItemStyle HorizontalAlign="Center" />
        </asp:BoundField>
        <asp:BoundField DataField="TRAC_ID" HeaderText="TRAC ID" 
            SortExpression="STATE,TRAC_NUM" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="PORTFOLIO" HeaderText="PORTFOLIO" 
            SortExpression="PORTFOLIO" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="PROPERTY_NM" HeaderText="PROPERTY NAME" 
            SortExpression="PROPERTY_NM" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="MARKET" HeaderText="MARKET" SortExpression="MARKET" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="REGION" HeaderText="REGION" SortExpression="REGION" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="PROGRAM" HeaderText="BLDG TYPE" SortExpression="PROGRAM" >
            <HeaderStyle VerticalAlign="Bottom" />
            <ItemStyle HorizontalAlign="Center" />
        </asp:BoundField>
        <asp:BoundField DataField="NATIONAL_IND" HeaderText="NATIONAL ACCT" SortExpression="NATIONAL_IND" >
            <HeaderStyle VerticalAlign="Bottom" />
            <ItemStyle HorizontalAlign="Center" />
        </asp:BoundField>
        <asp:BoundField DataField="AREA_MGR" HeaderText="AREA MGR" 
            SortExpression="AREA_MGR" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
        <asp:BoundField DataField="ACCT_MGR" HeaderText="ACCT MGR" 
            SortExpression="AREA_MGR" >
        <HeaderStyle VerticalAlign="Bottom" />
        </asp:BoundField>
    </Columns>
    <EditRowStyle BackColor="#DDDDDD" />
    <FooterStyle BackColor="#0A94D6" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#0A94D6" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#F7F6F3" />
    <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSrc1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ACC_NEW %>"
    SelectCommand="SELECT TRIM(TRAC_ID) TRAC_ID, PORTFOLIO, PROPERTY_NM, MARKET, REGION, DWELLING AS PROGRAM, REGION AS NATIONAL_IND, 
    AREA_MGR, ACCT_MGR, SUBSTR(TRAC_ID,1,2) STATE, CAST(SUBSTR(TRAC_ID,3) AS INTEGER) TRAC_NUM FROM PORTFOLIO_LOCATION_DWELLING_VIEW"
    onselecting="SqlDataSrc1_Selecting">
</asp:SqlDataSource>
</form>
</body>
</html>
